package cc.autoapi.pucong.auto.flow.core.flow.execNode.selfenum;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;

public enum JavaTypeEnum {

    INTEGER(0, Integer.class),
    STRING(1, String.class),
    BIG_DECIMAL(2, BigDecimal.class),
    DOUBLE(3, Double.class),
    FLOAT(4, Float.class),
    MAP(5, HashMap.class),
    LIST(6, ArrayList.class),
    DATE(7, Date.class);

    private Integer type;

    private Class c;

    JavaTypeEnum(Integer type, Class c) {
        this.type = type;
        this.c = c;
    }

    public JavaTypeEnum getItemByValue(Integer value) {
        JavaTypeEnum[] itemArr = JavaTypeEnum.values();
        if (value != null) {
            for (JavaTypeEnum item : itemArr) {
                if (value.equals(item.type)) {
                    return item;
                }
            }
        }
        return null;
    }
}
